import styled, {keyframes} from 'styled-components'

const successRectHoriz = keyframes`
  from{
    width: 0;
  }
  to{
    width: 100%;
  }
`
const successRectVertic = keyframes`
  from{
    height: 0;
  }
  to{
    height: 21px;
  }
`
const defaultOutsideWave = keyframes`
  0%{
    transform: scale(1)
  }
  20%{
    transform: scale(0.8)
  }
  40%{
    transform: scale(1)
  }
  60%{
    transform: scale(1)
  }
  100%{
    transform: scale(1)
  }
`
const defaultWave = keyframes`
  0%{
    transform: scale(1)
  }
  20%{
    transform: scale(1.2)
  }
  40%{
    transform: scale(1)
  }
  60%{
    transform: scale(1)
  }
  100%{
    transform: scale(1)
  }
`
const defaultRotate = keyframes`
    0% {
        transform: rotate(0deg);
    }

    20% {
        transform: rotate(72deg);
    }

    40% {
        transform: rotate(144deg);
    }

    60% {
        transform: rotate(216deg);
    }

    80% {
        transform: rotate(288deg);
    }

    100% {
        transform: rotate(360deg);
    }
`

export const LoginSty = styled.div`
  background-color: white;
  height: 100%;
  position: relative;
  .login-block-operate-m{
    position: absolute;
    top:0px;
    margin: auto;
    bottom: 0px;
    left: 0px;
    right: 0px;
    width: 80%;
    height: 70%;
    .tab{
      display: flex;
      justify-content: space-around;
      div{
        height: 70px;
        color: #222529;
        font-weight: 600;
        font-size: 18px;
        position: relative;
      }
      .active:after{
        content: "";
        display: block;
        width: 30px;
        height: 4px;
        background: #ff4338;
        position: absolute;
        left: 50%;
        bottom: 35px;
        transform: translateX(-50%);
      }
    }
    .panel{
      display: none;
      .text_input{
        border: 1px solid #ededed;
        margin-bottom: 25px;
        font-size: 13px;
        line-height: 30px;
      }
    }
    .send_validate{
      position: relative;
      .am-button-warning{
        position: absolute;
        top: 5px;
        right: 5px;
        background-color: #ff4338;
        width: 80px;
        font-size: 13px;
        line-height: 32px;
        height: 32px;
      }
    }
    .panel.active{
      display: block;
    }
    .sm-btn{
      width: 100%;
      height: 42px;
      border: 1px solid #ddd;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      
      .sm-ico{
        margin-left: 20px;
        width: 36px;
        height: 100%;
        display: inline-block;
        position: relative;
        .sm-ico-wave{
          width: 26px;
          height: 26px;
          border-radius: 50%;
          position: relative;
          z-index: 800;
          left: 5.5px;
          top: 7px;
          background-image: linear-gradient(0deg,#3a9afa,#00de76);
        }
        .out-silder-circle{
          top: 2px;
          position: absolute;
          background: #c3efe8;
          border-radius: 50%;
          width: 36px;
          height: 36px;
        }
      }
      .sm-ico.rotate{
        .out-silder-circle{
          animation: ${defaultRotate} 1s linear infinite;
          background: linear-gradient(rgba(0,222,118,.8),rgba(0,222,118,.4),rgba(0,222,118,.3),rgba(0,222,118,.2));
        }
      }
      .sm-ico.jump{
        .sm-ico-wave{
          animation: ${defaultWave} 1.5s;
          animation-iteration-count: infinite;
        }
        .out-silder-circle{
          animation: ${defaultOutsideWave} 1.5s;
          animation-iteration-count: infinite;
        }
      }
      .sm-txt{
        margin-left: 20px;
        color: #3c3c3c;
      }
      .border{
        position: absolute;
        width: 100%;
        height: 100%;
      }
      .border.active{
        box-shadow: 0 0 8px #65f4b5;
        .top{
          height: 21px;
          animation: ${successRectHoriz} 1s;
          width: 0;
          border-top: 1px solid #00de76;
          animation-delay: .5s;
          animation-iteration-count: 1;
          animation-fill-mode: forwards;
        }
        .top::before{
          border-left: 1px solid #00de76;
          animation: ${successRectVertic} 1s;
          animation-iteration-count: 1;
          animation-direction: reverse;
          animation-fill-mode: backwards;
          content: "";
          display: block;
          position: absolute;
          top: 0;
          left: 0;
        }
        .top::after{
          animation: ${successRectVertic} .5s;
          animation-delay: 1.5s;
          animation-iteration-count: 1;
          animation-fill-mode: forwards;
          border-right: 1px solid #00de76;
          content: "";
          display: block;
          position: absolute;
          top: 0px;
          right: 0;
        }
        .bottom{
          height: 21px;
          width: 0;
          border-bottom: 1px solid #00de76;
          animation: ${successRectHoriz} 1s;
          animation-delay: .5s;
          animation-iteration-count: 1;
          animation-fill-mode: forwards;
        }
        .bottom::before{
          border-left: 1px solid #00de76;
          animation: ${successRectVertic} .5s;
          animation-iteration-count: 1;
          animation-fill-mode: forwards;
          content: "";
          display: block;
          position: absolute;
          top: 21px;
          left: 0;
        }
        .bottom::after{
          animation: ${successRectVertic} .5s;
          animation-delay: 1.5s;
          animation-iteration-count: 1;
          animation-direction: reverse;
          animation-fill-mode: backwards;
          border-right: 1px solid #00de76;
          content: "";
          display: block;
          position: absolute;
          top: 21px;
          right: 0;
        }
      }
    }
    .submit{
      margin-top: 30px;
      .tip{
        margin-bottom: 10px;
        font-size: 11px;
        color: red;
      }
      .forgetPassword{
        margin-top: 10px;
        span{
          float: right;
        }
      }
    }
  }
`